﻿@model SDSystem.Models.Category
@using Ext.Net.MVC;
@using Ext.Net;
@{
    ViewBag.Title = "CreateCategory";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section ToolbarSection{
    @(Html.X().ButtonGroup().Items(
        Html.X().Button().Text("Save").Icon(Icon.Disk).DirectEvents(
        de=>
            {
                de.Click.Confirmation.ConfirmRequest = true;
                de.Click.Confirmation.Title = "Save";
                de.Click.Confirmation.Message = "Confirm?";
                de.Click.Url = Url.Action("CreateCategory");
                de.Click.EventMask.ShowMask = true;
                de.Click.FormID = "CreateCategoryView";
            }),
        Html.X().Button().Text("Back").Icon(Icon.PreviousGreen)
        ))
}




@(Html.X().FormPanel()
      .ID("CreateCategoryView")
      .BodyPadding(5)
      //.Buttons(buttons=>
      //             {
      //                 buttons.Add(
      //                     Html.X().Button().Text("Save").Icon(Icon.Disk).DirectEvents(
      //                      de =>
      //                      {
      //                          de.Click.Url = Url.Action("CreateCategory");
      //                          de.Click.EventMask.ShowMask = true;
      //                          de.Click.FormID = "CreateCategoryView";
      //                      })
      //                     );
      //                 buttons.Add(
      //                     Html.X().Button().Text("Back").Icon(Icon.PreviousGreen)
      //                     );
      //             })
      .Items(
          Html.X().FieldSet().Title("Category Details").Layout(LayoutType.Form).Padding(5).Items(
              Html.X().TextFieldFor(m=>m.CateName).FieldLabel("Category Name").LabelWidth(100).Width(600).LabelAlign(LabelAlign.Top),
              Html.X().HtmlEditorFor(m => m.Description).FieldLabel("Description").Height(150).LabelWidth(100).LabelAlign(LabelAlign.Top),
              Html.X().DateFieldFor(m=>m.DateCreate).FieldLabel("Date Create").LabelWidth(100).Width(250).LabelAlign(LabelAlign.Top).Value(ViewBag.DateCreate),
              Html.X().NumberFieldFor(m=>m.OrderBy).FieldLabel("Order By").MinValue(0).MaxValue(2).Value(0).Step(1).LabelWidth(100).Width(250).LabelAlign(LabelAlign.Top))))